package Main;

import java.awt.Point;
import java.util.ArrayList;

import Model.*;
import View.GraphicalView;

public class FlummoxMain {

	private static Maze curMaze;
	private static Player curPlayer;
	private static ArrayList<Monster> gameMonsters;
	private static Game game;
	private static GameAI gameAI;
	private static GameData gameData;
	private static GraphicalView view;

	private static FlummoxMain mySelf;
	public FlummoxMain(){
		mySelf = new FlummoxMain();
	}
	public static FlummoxMain getSelf(){
		return mySelf;
	}
	
	/**
	 * run the game
	 */
	public static void main(String[] args) {
		// Initialises new game and calls play
		//defaults first game to pacman
		curPlayer = new PacMan(Maze.PLAYER_START);
		gameMonsters  = new ArrayList<Monster>();
		curMaze = new Maze(Game.PACMAN_GAME, Maze.MAP_SIZE);
		Ghost rand = new Ghost(Maze.MONSTER_POS1, GameAI.RANDOM_MOVE);
		Ghost chaser = new Ghost(Maze.MONSTER_POS1, GameAI.CHASE_MOVE);
		Ghost fraid = new Ghost(Maze.MONSTER_POS1, GameAI.FLEEING_MOVE);
		gameMonsters.add(rand);
		gameMonsters.add(chaser);
		gameMonsters.add(fraid);
		gameData = new GameData(curPlayer,gameMonsters,curMaze);
		game = new Game(Game.PACMAN_GAME,gameData);
		gameAI = new GameAI(Game.PACMAN_GAME,game);
		view = new GraphicalView();
		gameAI.getGame().getData().getPlayerOfGame().addObserver(view);
		for( Monster gm:gameMonsters){
			gm.addObserver(view);
		}
		
	}
}
